package com.example.forum.services;

import com.example.forum.model.Message;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public interface MessageService {

    void create (Message message);

    Integer selectUnreadCount (Long userId);

    List<Message> selectByReceiveUserId (Long receiveUserId);

    Message selectById(Long id);

    void updateStateById(Long id, Byte state);

    @Transactional
    void reply (Long repliedId, Message message);

}
